const mongoose = require("mongoose");
const config = require("./index");
mongoose.connect(config.URL, {
  // @ts-ignore
  useNewUrlParser: true,
  useUnifiedTopology: true,
})
// .then(()=>{
//   console.log('连接成功');
// }).catch(()=>{
//   console.log('连接失败');
// })
const db = mongoose.connection;
db.on("error", console.error.bind(console, "connection error:"));
db.on("open", function () {
  console.log("#######连接成功######");
});
  